#ifndef MYBUTTON_H
#define MYBUTTON_H

#include <QWidget>
#include <QPainter>
/**
 * @brief The MyButton class
 * 自定义的按钮
 */
class MyButton : public QWidget
{
    Q_OBJECT
    //持有一个位图来绘制图片
    QPixmap picture;
public:
    explicit MyButton(QWidget *parent = nullptr);

public:
    void mousePressEvent(QMouseEvent *event) override;
    void enterEvent(QEvent *event) override;
    void leaveEvent(QEvent *event) override;
    void paintEvent(QPaintEvent *event) override;
signals:
    //自定义一个点击信号
    void my_click();

};

#endif // MYBUTTON_H
